package com.executor.gateway.core.exception;

/**
 * 熔断器开启异常
 * 当熔断器处于开启状态时抛出此异常
 * 
 * @author miaoguoxin
 * @date 2024/01/01
 */
public class CircuitBreakerOpenException extends RuntimeException {
    
    private final String serviceId;
    
    public CircuitBreakerOpenException(String serviceId) {
        super("Circuit breaker is open for service: " + serviceId);
        this.serviceId = serviceId;
    }
    
    public CircuitBreakerOpenException(String serviceId, String message) {
        super(message);
        this.serviceId = serviceId;
    }
    
    public String getServiceId() {
        return serviceId;
    }
}